package glbm

import (
	"gitee.com/liumou_site/gcs"
	"gitee.com/liumou_site/gf"
	"gitee.com/liumou_site/glbm/apt"
	"gitee.com/liumou_site/glbm/dpkg"
	"gitee.com/liumou_site/glbm/file"
	"gitee.com/liumou_site/glbm/network"
	"gitee.com/liumou_site/glbm/service"
	// "gitee.com/liumou_site/glbm/system" // 如需系统信息可解开注释
)

// GlbmManager 统一管理所有子模块功能
// 可根据实际需求扩展字段
type GlbmManager struct {
	Apt        *apt.AptStruct
	Dpkg       *dpkg.DpkgStruct
	File       *file.FileStruct
	FileSudo   *file.FileSudoStruct
	Network    *network.NmcliStruct
	Connection *network.NmcliConnectionStruct
	Service    *service.ServiceStruct
	// SystemInfo *system.OsInfo // 如需系统信息可解开注释
}

// NewGlbmManager 统一初始化方法
func NewGlbmManager(password string) *GlbmManager {
	sudo := gcs.NewSudo(password)
	dpkgInstance := dpkg.NewDpkg(sudo, false)
	shell := gcs.NewShell()
	fileMan := gf.NewFileMan("", "")
	nmcli := network.NewNmcli()
	return &GlbmManager{
		Apt:        apt.NewApt(sudo, dpkgInstance, false, false),
		Dpkg:       dpkgInstance,
		File:       file.NewFile("", shell, fileMan),
		FileSudo:   file.NewFileSudo("", sudo, shell, fileMan),
		Network:    nmcli,
		Connection: network.NewConnect(nmcli, false),
		Service:    service.NewService("", sudo),
		// SystemInfo: &system.OsInfo{},
	}
}
